Should pass the exception along to xm/main.py to handle properly like
the rest of the commands.
Signed-off-by: Alastair Tse <atse@xensource.com>
if len(argv) != 2:
raise OptionError('No policy defined')
- try:
- load_policy(argv[1])
-
- except ACMError:
- sys.exit(-1)
- except:
- traceback.print_exc(limit = 1)
+ load_policy(argv[1])
if __name__ == '__main__':
- main(sys.argv)
-
-
+ try:
+ main(sys.argv)
+ except Exception, e:
+ sys.stderr.write('Error: %s\n' % str(e))
+ sys.exit(-1)
+
if len(argv) != 2:
raise OptionError('No XML policy file specified')
- try:
- make_policy(argv[1])
- except ACMError:
- sys.exit(-1)
- except:
- traceback.print_exc(limit=1)
- sys.exit(-1)
-
+ make_policy(argv[1])
if __name__ == '__main__':
- main(sys.argv)
+ try:
+ main(sys.argv)
+ except Exception, e:
+ sys.stderr.write('Error: %s\n' % str(e))
+ sys.exit(-1)